package com.fly.autogetcode;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import butterknife.ButterKnife;
import butterknife.OnClick;
/**
 * Created by weifeiyang on 2016/7/29 0029.
 */
public class MainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
    }

    /**
     * <pre>
     *   广播方式
     * </pre>
     */
    @OnClick(R.id.broad_cast_btn)
    public void broadCastClick() {
        Intent intent =new Intent(this,CommonActivity.class);
        intent.putExtra("flag","broad_cast");
        startActivity(intent);
    }

    /**
     * <pre>
     *   数据库方式
     * </pre>
     */
    @OnClick(R.id.content_oberver_btn)
    public void contentOberverClick() {
        Intent intent =new Intent(this,CommonActivity.class);
        intent.putExtra("flag","content_oberver");
        startActivity(intent);
    }
}
